export enum conditionE {
  include = 1,
  exclusive,
  is,
  isNot,
  prefix,
  suffix,
  isNull,
  isNotNull,
  inScope,
  equal,
  unequal,
  greater,
  less,
  greaterThan,
  lessThan,
  notInScope,
  before,
  past
}
/* 1	包含	include
2	不包含	exclusive
3	是	is
4	不是	isNot
5	开头为	prefix
6	结尾为	suffix
7	为空	isNull
8	不为空	isNotNull
9	在范围内 inScope
10	等于	equal
11	不等于	unequal
12	大于	greater
13	小于	less
14	大于等于	greaterThan
15	小于等于	lessThan
16	不在范围内	notInScope
17	早于 before
18	晚于	past */
const textFilter = [
  ['包含', conditionE.include],
  ['不包含', conditionE.exclusive],
  ['是', conditionE.is],
  ['不是', conditionE.isNot],
  ['开头为', conditionE.prefix],
  ['结尾为', conditionE.suffix],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))

const slaFilter = [
  ['是', conditionE.is],
  ['不是', conditionE.isNot]
].map((item) => ({ label: item[0], value: item[1] }))

const numberFilter = [
  ['在范围内', conditionE.inScope],
  ['不在范围内', conditionE.notInScope],
  ['等于', conditionE.equal],
  ['不等于', conditionE.unequal],
  ['大于', conditionE.greater],
  ['小于', conditionE.less],
  ['大于等于', conditionE.greaterThan],
  ['小于等于', conditionE.lessThan],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))
const autoNumberFilter = [
  ['包含', conditionE.include],
  ['不包含', conditionE.exclusive],
  ['是', conditionE.is],
  ['不是', conditionE.isNot],
  ['开头为', conditionE.prefix],
  ['结尾为', conditionE.suffix],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))
const radioFilter = [
  ['是', conditionE.is],
  ['不是', conditionE.isNot],
  ['包含', conditionE.include],
  ['不包含', conditionE.exclusive],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))

const checkboxFilter = [
  ['包含', conditionE.include],
  ['不包含', conditionE.exclusive],
  ['是', conditionE.is],
  ['不是', conditionE.isNot],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))

const phoneFilter = [
  ['包含', conditionE.include],
  ['不包含', conditionE.exclusive],
  ['是', conditionE.is],
  ['不是', conditionE.isNot],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))
const dateTimeFilter = [
  ['是', conditionE.is],
  ['不是', conditionE.isNot],
  ['早于', conditionE.before],
  ['晚于', conditionE.past],
  ['在范围内', conditionE.inScope],
  ['不在范围内', conditionE.notInScope],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))
const simple = [
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))
const memberFilter = [
  ['是', conditionE.is],
  ['不是', conditionE.isNot],
  ['包含', conditionE.include],
  ['不包含', conditionE.exclusive],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))
const regionFilter = [
  ['是', conditionE.is],
  ['不是', conditionE.isNot],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))
const cascadeSelectFilter = [
  ['是', conditionE.is],
  ['不是', conditionE.isNot],
  ['包含', conditionE.include],
  ['不包含', conditionE.exclusive],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))
const timeLimitFilter = [
  // ['在范围内', conditionE.inScope],
  // ['不在范围内', conditionE.notInScope],
  ['为空', conditionE.isNull],
  ['不为空', conditionE.isNotNull]
].map((item) => ({ label: item[0], value: item[1] }))
export const filterConditon = {
  signFilter: timeLimitFilter,
  textFilter,
  multiTextFilter: textFilter,
  phoneFilter,
  emailFilter: textFilter,
  numberFilter,
  radioFilter,
  checkboxFilter,
  dateTimeFilter,
  regionFilter,
  cascadeSelectFilter,
  memberFilter,
  departmentFilter: memberFilter,
  accessoryFilter: simple,
  associateServiceFilter: simple,
  autoNumberFilter,
  associateSpareFilter: simple,
  statisticsFilter: numberFilter,
  timeLimitFilter,
  associateUserFilter: simple,
  stepBarFilter: radioFilter,
  slaFilter
}
